TIMES
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
BSD 4
NAME
times
- process times
SYNOPSIS
Fd #include <sys/times.h>
Ft clock_t
Fn times struct tms *tp
DESCRIPTION
Bf -symbolic
This interface is obsoleted by getrusage(2)
and gettimeofday(3).
Ef
The
Fn times
function returns the value of time in
CLK_TCK 's
of a second since
0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal
Time.
It also fills in the structure pointed to by
Fa tp
with time-accounting information.
The
Fa tms
structure is defined as follows:
typedef struct {
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
}
The elements of this structure are defined as follows:
- Fa tms_utime
-
The
CPU
time charged for the execution of user instructions.
- Fa tms_stime
-
The
CPU
time charged for execution by the system on behalf of
the process.
- Fa tms_cutime
-
The sum of the
Fa tms_utime s
and
Fa tms_cutime s
of the child processes.
- Fa tms_cstime
-
The sum of the
Fa tms_stime Ns s
and
Fa tms_cstime Ns s
of the child processes.
All times are in
CLK_TCK 's
of a second.
The times of a terminated child process are included in the
Fa tms_cutime
and
Fa tms_cstime
elements of the parent when one of the
wait(2)
functions returns the process ID of the terminated child to the parent.
If an error occurs,
Fn times
returns the value
((clock_t)-1)
and sets
errno
to indicate the error.
ERRORS
The
Fn times
function
may fail and set the global variable
errno
for any of the errors specified for the library
routines
getrusage(2)
and
gettimeofday(2).
SEE ALSO
time(1),
getrusage(2),
gettimeofday(2),
wait(2)
STANDARDS
The
Fn times
function
conforms to
St -p1003.1-88 .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- ERRORS
-
- SEE ALSO
-
- STANDARDS
-
This document was created by
man2html,
using the manual pages.
Time: 16:28:56 GMT, April 18, 2022